$(function () {
	layui.use('table', function () {
		var table = layui.table

		table.render({
			elem: '#test-table',
			url: '/Do/MS/queryMsBatchFileJson?' + $("#searchform").serialize(), //数据接口
			page: true,
			cols: [
				[
		      {type:'checkbox',fixed:'left', width: 50},
					{ field: 'paperName', title: '试卷名称', width: '55%'},
					{ field: 'paperPurpose', title: '试卷用途', width: '6%' },
					{ field: 'paperType', title: '试卷类型', width: '6%' },
					{ field: 'position', title: '所属岗位	', width: '7%' },
					{ field: 'totalScore', title: '总分', width: '5%' },
					{ field: 'addName', title: '创建人', width: '6%' },
					{ field: 'addTime', title: '创建时间', width: '7%' },
					{ field: 'paperState', title: '状态', width: '7%' },
				],
			],
    })

    $('#test_answer').on('click', function() {
      layer.open({
        type: 1,
        title: '试卷答案',
        content: $('#answer-page'),
        offset: '30px',
        area: ['700px', '600px']
      })

      table.render({
        elem: '#answer-table',
        url: '/Do/MS/queryMsBatchFileJson?' + $("#searchform").serialize(), //数据接口
        page: true,
        cols: [
          [
            { field: 'paperName', title: '题目序号', width: '20%'},
            { field: 'paperPurpose', title: '答案', width: '30%' },
            { field: 'paperName', title: '题目序号', width: '20%'},
            { field: 'paperPurpose', title: '答案', width: '30%' },
          ],
        ],
      })
    })

    $('#test_list').on('click', function() {
      layer.open({
        type: 1,
        title: '试卷答案',
        content: $('#list-page'),
        offset: '30px',
        area: ['700px', '600px']
      })

      table.render({
        elem: '#list-table',
        url: '/Do/MS/queryMsBatchFileJson?' + $("#searchform").serialize(), //数据接口
        page: true,
        cols: [
          [
            { field: 'paperName', title: '题目序号', width: '20%'},
            { field: 'paperPurpose', title: '答案', width: '30%' },
            { field: 'paperName', title: '题目序号', width: '20%'},
            { field: 'paperPurpose', title: '答案', width: '30%' },
          ],
        ],
      })
    })
  })
})
